package com.qianyu.project.core.service;


import com.qianyu.project.core.bean.FlowNode;

import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

/**
 * @author gs
 * @date create in 2020/12/11 16:06
 */
public interface IFlowNodeService {
    /**
     * description: 依据流程号提供第一个节点 <br/>
     * author: gs   <br/>
     * date: 2020/12/12 <br/>
     * params: [flowId] <br/>
     * return: com.qianyu.flow.core.pojo.FlowNode
     */
    FlowNode renderFirtstNode(@NotNull Integer flowId);

    /**
     * description: 依据节点提供它下一个节点 <br/>
     * author: gs   <br/>
     * date: 2020/12/12 <br/>
     * params: [flowNode] <br/>
     * return: com.qianyu.flow.core.pojo.FlowNode
     */
    FlowNode renderNextNode(FlowNode flowNode);

    /**
     * description: 通过id获取节点 <br/>
     * author: gs   <br/>
     * date: 2020/12/12 <br/>
     * params: [flowNodeId] <br/>
     * return: com.qianyu.flow.core.pojo.FlowNode
     */
    FlowNode getById(@NotNull Integer flowNodeId);

    /**
     * description: 查询目标表的需要限制的字段 <br/>
     * author: gs   <br/>
     * date: 2021/1/7 <br/>
     * params: [target, field, id] <br/>
     * return: java.lang.String
     */
    String getTargetValue(Map<String,String> params);

    /**
     * description: 根据flowid查询所有节点 <br/>
     * author: mfy   <br/>
     * date:  <br/>
     * params:  <br/>
     * return: 
     */
    List<FlowNode> getListByFlowId(Integer flowId);

    /*
     * description: 添加节点 <br/>
     * author: mfy   <br/>
     * date:  <br/>
     * params:  <br/>
     * return:
     */
    void saveBatch(List<FlowNode> nodeList);

    /*
     * description: 修改状态 <br/>
     * author: mfy   <br/>
     * date:  <br/>
     * params:  <br/>
     * return: 
     */
    void update(Integer flowId);

    /*
     * description: 根据流程id删除流程节点 <br/>
     * author: mfy   <br/>
     * date:  <br/>
     * params:  <br/>
     * return: 
     */
    void delete(Integer flowId);
}
